package com.bw.a1908.model;

import com.bw.a1908.api.Api;
import com.bw.a1908.bean.VideoBean;
import com.bw.a1908.contract.VideoContract;
import com.bw.a1908.core.http.HttpFactory;
import com.bw.a1908.core.http.base.ProductType;
import com.bw.a1908.core.http.call.CallObserver;
import com.bw.a1908.core.mvp.BaseMode;

import java.util.List;

import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;

public
class VideoModel extends BaseMode implements VideoContract.Model {
    @Override
    public void requestVideo(int channel, CallObserver<List<VideoBean>> observer) {
        HttpFactory.getInstance().create(ProductType.NETWORK).getRetrofit()
                .create(Api.class)
                .videoList(String.valueOf(channel),"1","20")
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(observer);
    }
}
